label: Plug a potential memory leak
authorTimm Bäder <mail@baedert.org>
Thu, 15 Oct 2020 04:06:43 +0000 (06:06 +0200)
committerTimm Bäder <mail@baedert.org>
Thu, 22 Oct 2020 15:46:33 +0000 (17:46 +0200)
This only happens in error cases so pretty insignificant.

Found by scan-build

gtk/gtklabel.c

index 70f9152d5f494fd6c86fdb86e6b07617a171d891..2b3ee4c102d9ed45d9d51b92251ba011904804ac 100644 (file)
@@ -2337,7 +2337,10 @@ no_uline:
           char *text_for_accel;
 
           if (!pango_parse_markup (str_for_display, -1, 0, NULL, &text_for_accel, NULL, &error))
-            goto error_set;
+            {
+              g_free (new_text);
+              goto error_set;
+            }
 
           extract_mnemonic_keyval (text_for_accel,
                                    NULL,